import { request } from '@/api/request'
import { encrypt } from '@/utils/jsencrypt'

// 登录
export function login(data) {
  return request({
    url: '/login',
    method: 'post',
    data: {
      ...data,
      // password: encrypt(data.password),
    }
  })
}

// 短信登录
export function codeLogin(data) {
  return request({
    url: '/smsLogin',
    method: 'post',
    data: data
  })
}


export function getInfo(parms) {
  return request({
    url: '/getInfo',
    method: 'get',
    parms
  })
}

// 获取路由列表
export function getRouter(parms) {
  return request({
    url: '/getRouters',
    method: 'get',
    parms
  })
}

// 获取用户信息
export function getUserInfo() {
  return request({
    url: '/system/user/getUserInfo',
    method: 'get'
  })
}

// 修改用户信息
export function putUserInfo(data) {
  return request({
    url: '/system/user/profile',
    method: 'put',
    data: data
  })
}

// 用户（企业）认证
export function postAuthen(data) {
  return request({
    url: '/system/authentication',
    method: 'post',
    data: data
  })
}

// 修改密码
export function updatePwd(data) {
  return request({
    url: '/system/user/profile/updatePwd',
    method: 'put',
    data: data
  })
}


// 解绑微信
export function unbindWechat(data) {
  return request({
    url: '/system/user/wechat/unbind',
    method: 'post',
    data: data
  })
}



// 查询
export function settingList(params) {
  return request({
    url: '/system/setting/list',
    method: 'get',
    params
  })
}
